%%%-------------------------------------------------------------------
%%% @author liuwentao
%%% @doc
%%%         触发器头文件
%%% @end
%%% Created : 19. 7月 2021 14:24
%%%-------------------------------------------------------------------
-author("liuwentao").

%% 触发器定义
-record(trigger, {
    id = 1 :: pos_integer()
    %% 标签
    , label :: atom()
    %% 回调模块
    , m :: undefined | atom()
    %% 回调函数
    , f :: function() | atom()
    %% 参数函数，在回调时系统会自动在前面添加Evt和Role参数
    , a = [] :: list()
}).


%%======================================================================
%%                      触发器定义
%%======================================================================

%% 获得物品事件
-record(evt_get_item, {
    %% 物品基础ID
    base_id = 1 :: pos_integer()
    %% 获得数量
    , num = 1 :: pos_integer()
}).

%% 删除物品
-record(evt_del_item, {
    %% 物品基础ID
    base_id :: pos_integer()
    %% 物品数量
    , num = 0 :: pos_integer()
}).

%% 获得钻石事件
-record(evt_gain_diamonds, {
    val = 0 :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 失去钻石事件
-record(evt_loss_diamonds, {
    val :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 获得黄金事件
-record(evt_gain_gold, {
    val = 0 :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 失去黄金事件
-record(evt_loss_gold, {
    val :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 获得石币事件
-record(evt_gain_stone_coin, {
    val = 0 :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 失去石币事件
-record(evt_loss_stone_coin, {
    val :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 获得经验事件
-record(evt_gain_exp, {
    val = 0 :: pos_integer()
    , reason = 0 :: pos_integer()
}).

%% 失去经验事件
-record(evt_loss_exp, {
    val :: pos_integer()
    , reason = 0 :: pos_integer()
}).

